#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main() {
    char a;
    int n = 0, m = 0;
    while (scanf("%c", &a) != EOF) {
        if (a == '0')break;
        if (a == 'A')
            n++;
        else
            m++;
    }
    if (n > m)
        printf("A");
    else if (n < m)
        printf("B");
    else
        printf("E");
    return 0;
}